package 常用集合与排序;

import java.util.Arrays;

public class Sort {
    public static void main(String[] args) {
        String text = "a bb cc ddd e";
        String[] ss = text.split(" ");
//        Arrays.sort(ss, Comparator.comparingInt(String::length));
        Arrays.sort(ss, (o1, o2) -> o1.length() - o2.length());
        System.out.println(Arrays.toString(ss));

    }
}
